import request from "@/utils/request";

const api_name = "/sysUser";

export default {
  getPageList(pageNo, pageSize, searchObj) {
    return request({
      url: `${api_name}/${pageNo}/${pageSize}`,
      method: "get",
      params: searchObj, // url查询字符串或表单键值对
    });
  },
  getById(id) {
    return request({
      url: `${api_name}/${id}`,
      method: "get",
    });
  },

  save(role) {
    return request({
      url: `${api_name}/save`,
      method: "post",
      data: role,
    });
  },

  updateById(role) {
    return request({
      url: `${api_name}/update`,
      method: "put",
      data: role,
    });
  },
  removeById(id) {
    return request({
      url: `${api_name}/${id}`,
      method: "delete",
    });
  },

  //批量删除
  batchRemove(idList) {
    return request({
      url: `${api_name}/removeByIds`, // 更新为正确的路径
      method: `delete`, 
      data: idList,
    });
  },
  //修改状态
  updateStatus(id, status) {
    return request({
      url: `${api_name}/updateStatus/${id}/${status}`,
      method: 'get'
    })
  },

  
};
